from nebula3.Config import SessionPoolConfig
from nebula3.gclient.net.SessionPool import SessionPool

from server.settings import Settings

config = SessionPoolConfig()


# init session pool
graph_session = SessionPool(
    Settings.database_settings.NEBULA_USER,
    Settings.database_settings.NEBULA_PASSWORD,
    Settings.database_settings.NEBULA_SPACE_NAME,
    [(Settings.database_settings.NEBULA_HOST, Settings.database_settings.NEBULA_PORT)]
)
assert graph_session.init(config)